﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PopunjavanjeSesije.aspx.cs" Inherits="Knjiga.PopunjavanjeSesije" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>


<%
    if (Application["Posete"] == null)
    {
        Application.Lock();
        Application["Posete"] = 0;
        Application.UnLock();
    }

    int nPoseta = (int)Application["Posete"];
    nPoseta = nPoseta + 1;
    Application.Lock();
    Application["Posete"] = nPoseta;
    Application.UnLock();
     %>
Ovaj sajt je posecen: 
<% Response.Write(Application["Posete"].ToString());
     %>

<h3>Trenutne stavke u objektu Session</h3>
    <form id="form1" runat="server">
    <div>
    <table border="1">
    <tr>
    <td>Ime stavke</td>
    <td>Vrednost</td>
    </tr>
    <%
        String strImeKljucaSesije;
        String strStavkaSesije;
        for (int i = 0; i < Session.Count; i++)
        {
            strImeKljucaSesije = Session.Keys[i];
            strStavkaSesije = (String)Session[i];
            Response.Write("<tr><td>" + strImeKljucaSesije + "</td><td>" + strStavkaSesije + "</td></tr>"); 
        }
                
         %>
    
    </table>
    <br />
    Kljuc: 
        <asp:TextBox ID="Kljuc" runat="server"></asp:TextBox> <br />
        Vrednost: 
        <asp:TextBox ID="Vrednost" runat="server"></asp:TextBox><br />
        <asp:Button ID="Button1" runat="server"  Text="Dodaj" onclick="KliknutoDodaj" /><br />
        <asp:Button ID="Button2" runat="server" Text="Ukloni" onclick="KlikUkloni" />
    </div>
    </form>
</body>
</html>
